package DataStructureAndAlgorithm.CSP.Day03;
import java.util.Scanner;
public class AcWing_3203 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        boolean[][] st = new boolean[101][101];
        int n = in.nextInt();
        for (int i = 0; i < n; i++){
            int x1 = in.nextInt();
            int y1 = in.nextInt();
            int x2 = in.nextInt();
            int y2 = in.nextInt();
            for (int j = x1; j < x2; j++){
                for (int k = y1; k < y2; k++){
                    st[j][k] = true;
                }
            }
        }
        int res = 0;
        for (int i = 0; i < 101; i++){
            for (int j = 0; j < 101; j++){
                if (st[i][j])res++;
            }
        }
        System.out.print(res);
    }
}
